#include "main.h"
#include "sample_common.h"
#include "rkmedia_api.h"
#include "rkmedia_venc.h"
#include "signal.h"

void exit_back_funtion(void)
{
	if(close(h_info.sockfd) == 0)
	{
		return ;
	}
	close(h_info.sockfd);
	exit(0);
}

void signal_backfunction(int signum)//
{
	signum = signum;
	if(close(h_info.sockfd) == 0)
	{
		exit(0);
		return ;
	}
	close(h_info.sockfd);
	exit(0);
}

struct helmet_info h_info;

int main(void)
{
	video_node = "rkispp_scale0";
	get_av_node();
	signal(2,signal_backfunction);
	atexit(exit_back_funtion);
	//printf("sizeof(HELMET_MSG)==%d\r\n",sizeof(HELMET_MSG_test));
//1：初始化自身
	Init_Sys();
//2：初始化网络
	Init_MyNetWork();
//3:初始化摄像头
	Init_MyCamera();
//4:初始化音频
	Init_Audio();
//5:初始化 Muxer合成器
	Init_Muxter();

	while(1)
	{
		sleep(1);
	}

	return 0;
}

